* Apply to: roadmaps_1.dta
* Description:  Table A9 in the OA

clear

set more off


use "...\1805 Roadmaps\roadmaps_1.dta", clear


* Treatment variables

gen con = 0
replace con = 1 if ctr_marlee!=.

gen vgd = 0
replace vgd = 1 if vgd_marlee!=.

gen pty = 0
replace pty = 1 if pty_marlee!=.

gen psi = 0
replace psi = 1 if psi_marlee!=.

gen psp = 0
replace psp = 1 if psp_marlee!=.

gen an3 = 0
replace an3 = 1 if end_marlee!=.
replace an3 = 1 if end_ideo_marlee!=.


gen all_info = 0
replace all_info = 1 if (vgd==1 | pty==1 | psi==1 | psp==1)


* Drop extraneous respondents

drop if an3==1
drop if party=="Other"
drop if (con==0 & vgd==0 & pty==0 & psi==0 & psp==0)
drop end_marlee end_ideo_marlee


* Dependent variables

gen marlee = ctr_marlee
replace marlee = vgd_marlee if vgd==1
replace marlee = pty_marlee if pty==1
replace marlee = psi_marlee if psi==1
replace marlee = psp_marlee if psp==1

gen vote_marlee = 0
replace vote_marlee = 1 if marlee==1
replace vote_marlee = . if marlee==3

gen vote_leemar = 1
replace vote_leemar = 0 if marlee==1
replace vote_leemar = . if marlee==3


* Treatment-knowledge interactions

* Recode know_sco = 0 to know_sco = 1

replace know_sco = 1 if know_sco==0


gen con_know = con * know_sco
gen vgd_know = vgd * know_sco
gen pty_know = pty * know_sco
gen psi_know = psi * know_sco
gen psp_know = psp * know_sco

gen all_info_know = all_info * know_sco


* Treatment-ideology interactions

gen con_D1 = con * d1
gen pty_D1 = pty * d1
gen an3_D1 = an3 * d1
gen vgd_D1 = vgd * d1
gen psi_D1 = psi * d1
gen psp_D1 = psp * d1

gen all_info_D1 = all_info * d1


* Treatment-knowledge-ideology interactions

gen con_know_D1 = con_know * d1
gen vgd_know_D1 = vgd_know * d1
gen pty_know_D1 = pty_know * d1
gen psi_know_D1 = psi_know * d1
gen psp_know_D1 = psp_know * d1

gen all_info_know_D1 = all_info_know * d1


set more off

*log using "...\1805 Roadmaps\Table A9.log", replace

set seed X075bcd151f123bb5159a55e50022865700043e55


probit vote_leemar ///
     con con_know con_D1 con_know_D1 ///
     vgd vgd_know vgd_D1 vgd_know_D1 ///
     pty pty_know pty_D1 pty_know_D1 ///
     psi psi_know psi_D1 psi_know_D1 ///
     psp psp_know psp_D1 psp_know_D1 ///
     , noconstant

tabstat know_sco if e(sample), s(n mean sd min p25 p50 p75 max)
tabstat d1 if e(sample), s(n mean sd min p25 p50 p75 max)


estsimp probit vote_leemar ///
     con con_know con_D1 con_know_D1 ///
     vgd vgd_know vgd_D1 vgd_know_D1 ///
     pty pty_know pty_D1 pty_know_D1 ///
     psi psi_know psi_D1 psi_know_D1 ///
     psp psp_know psp_D1 psp_know_D1 ///
    , noconstant


* Knowledge = 1

setx median
setx con 1
setx con_know 1
setx con_D1 .486
setx con_know_D1 .486
simqi, pr listx

simqi, fd(prval(1) genpr(fd_con1)) changex(con_D1 0.415 1.026 con_know_D1 .0415 1.026)


setx con_D1 0
setx con_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(tr_pty_con1)) changex(con 1 0 con_know 1 0 pty 0 1 pty_know 0 1)
simqi, fd(prval(1) genpr(tr_vgd_con1)) changex(con 1 0 con_know 1 0 vgd 0 1 vgd_know 0 1)
simqi, fd(prval(1) genpr(tr_psi_con1)) changex(con 1 0 con_know 1 0 psi 0 1 psi_know 0 1)
simqi, fd(prval(1) genpr(tr_psp_con1)) changex(con 1 0 con_know 1 0 psp 0 1 psp_know 0 1)


setx median
setx vgd 1
setx vgd_know 1
setx vgd_D1 .486
setx vgd_know_D1 .486
simqi, pr listx

simqi, fd(prval(1) genpr(fd_vgd1)) changex(vgd_D1 0.415 1.026 vgd_know_D1 .0415 1.026)


setx vgd_D1 0
setx vgd_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(tr_pty_vgd1)) changex(vgd 1 0 vgd_know 1 0 pty 0 1 pty_know 0 1)
simqi, fd(prval(1) genpr(tr_psi_vgd1)) changex(vgd 1 0 vgd_know 1 0 psi 0 1 psi_know 0 1)
simqi, fd(prval(1) genpr(tr_psp_vgd1)) changex(vgd 1 0 vgd_know 1 0 psp 0 1 psp_know 0 1)


setx median
setx pty 1
setx pty_know 1
setx pty_D1 .486
setx pty_know_D1 .486
simqi, pr listx

simqi, fd(prval(1) genpr(fd_pty1)) changex(pty_D1 0.415 1.026 pty_know_D1 .0415 1.026)


setx pty_D1 0
setx pty_know_D1 0
simqi, pr listx


setx median
setx psi 1
setx psi_know 1
setx psi_D1 .486
setx psi_know_D1 .486
simqi, pr listx

simqi, fd(prval(1) genpr(fd_psi1)) changex(psi_D1 0.415 1.026 psi_know_D1 .0415 1.026)


setx psi_D1 0
setx psi_know_D1 0
simqi, pr listx


setx median
setx psp 1
setx psp_know 1
setx psp_D1 .486
setx psp_know_D1 .486
simqi, pr listx

simqi, fd(prval(1) genpr(fd_psp1)) changex(psp_D1 0.415 1.026 psp_know_D1 .0415 1.026)


setx psp_D1 0
setx psp_know_D1 0
simqi, pr listx


* Difference in baseline probabilities

tabstat tr_vgd_con1, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_pty_con1, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psi_con1, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psp_con1, s(mean sd min p5 p10 p50 p90 p95 max)


tabstat tr_pty_vgd1, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psi_vgd1, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psp_vgd1, s(mean sd min p5 p10 p50 p90 p95 max)


* Calculate difference in first differences

gen dif_vgd_con1 = fd_vgd1 - fd_con1
gen dif_pty_con1 = fd_pty1 - fd_con1
gen dif_psi_con1 = fd_psi1 - fd_con1
gen dif_psp_con1 = fd_psp1 - fd_con1

tabstat dif_vgd_con1, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_pty_con1, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psi_con1, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psp_con1, s(mean sd min p5 p10 p50 p90 p95 max)


gen dif_pty_vgd1 = fd_pty1 - fd_vgd1
gen dif_psi_vgd1 = fd_psi1 - fd_vgd1
gen dif_psp_vgd1 = fd_psp1 - fd_vgd1

tabstat dif_pty_vgd1, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psi_vgd1, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psp_vgd1, s(mean sd min p5 p10 p50 p90 p95 max)


* Knowledge = 2

setx median
setx con 1
setx con_know 2
setx con_D1 .486
setx con_know_D1 .972
simqi, pr listx

simqi, fd(prval(1) genpr(fd_con2)) changex(con_D1 0.415 1.026 con_know_D1 .083 2.412)


setx con_D1 0
setx con_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(tr_pty_con2)) changex(con 1 0 con_know 2 0 pty 0 1 pty_know 0 2)
simqi, fd(prval(1) genpr(tr_vgd_con2)) changex(con 1 0 con_know 2 0 vgd 0 1 vgd_know 0 2)
simqi, fd(prval(1) genpr(tr_psi_con2)) changex(con 1 0 con_know 2 0 psi 0 1 psi_know 0 2)
simqi, fd(prval(1) genpr(tr_psp_con2)) changex(con 1 0 con_know 2 0 psp 0 1 psp_know 0 2)


setx median
setx vgd 1
setx vgd_know 2
setx vgd_D1 .486
setx vgd_know_D1 .972
simqi, pr listx

simqi, fd(prval(1) genpr(fd_vgd2)) changex(vgd_D1 0.415 1.026 vgd_know_D1 .083 2.412)


setx vgd_D1 0
setx vgd_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(tr_pty_vgd2)) changex(vgd 1 0 vgd_know 2 0 pty 0 1 pty_know 0 2)
simqi, fd(prval(1) genpr(tr_psi_vgd2)) changex(vgd 1 0 vgd_know 2 0 psi 0 1 psi_know 0 2)
simqi, fd(prval(1) genpr(tr_psp_vgd2)) changex(vgd 1 0 vgd_know 2 0 psp 0 1 psp_know 0 2)


setx median
setx pty 1
setx pty_know 2
setx pty_D1 .486
setx pty_know_D1 .972
simqi, pr listx

simqi, fd(prval(1) genpr(fd_pty2)) changex(pty_D1 0.415 1.026 pty_know_D1 .083 2.412)


setx pty_D1 0
setx pty_know_D1 0
simqi, pr listx


setx median
setx psi 1
setx psi_know 2
setx psi_D1 .486
setx psi_know_D1 .972
simqi, pr listx

simqi, fd(prval(1) genpr(fd_psi2)) changex(psi_D1 0.415 1.026 psi_know_D1 .083 2.412)


setx psi_D1 0
setx psi_know_D1 0
simqi, pr listx


setx median
setx psp 1
setx psp_know 2
setx psp_D1 .486
setx psp_know_D1 .972
simqi, pr listx

simqi, fd(prval(1) genpr(fd_psp2)) changex(psp_D1 0.415 1.026 psp_know_D1 .083 2.412)


setx psp_D1 0
setx psp_know_D1 0
simqi, pr listx


* Difference in baseline probabilities

tabstat tr_vgd_con2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_pty_con2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psi_con2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psp_con2, s(mean sd min p5 p10 p50 p90 p95 max)


tabstat tr_pty_vgd2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psi_vgd2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psp_vgd2, s(mean sd min p5 p10 p50 p90 p95 max)


* Calculate difference in first differences

gen dif_vgd_con2 = fd_vgd2 - fd_con2
gen dif_pty_con2 = fd_pty2 - fd_con2
gen dif_psi_con2 = fd_psi2 - fd_con2
gen dif_psp_con2 = fd_psp2 - fd_con2

tabstat dif_vgd_con2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_pty_con2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psi_con2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psp_con2, s(mean sd min p5 p10 p50 p90 p95 max)


gen dif_pty_vgd2 = fd_pty2 - fd_vgd2
gen dif_psi_vgd2 = fd_psi2 - fd_vgd2
gen dif_psp_vgd2 = fd_psp2 - fd_vgd2

tabstat dif_pty_vgd2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psi_vgd2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psp_vgd2, s(mean sd min p5 p10 p50 p90 p95 max)


* Knowledge = 3

setx median
setx con 1
setx con_know 3
setx con_D1 .486
setx con_know_D1 1.458
simqi, pr listx

simqi, fd(prval(1) genpr(fd_con3)) changex(con_D1 0.415 1.026 con_know_D1 .1245 3.618)


setx con_D1 0
setx con_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(tr_pty_con3)) changex(con 1 0 con_know 3 0 pty 0 1 pty_know 0 3)
simqi, fd(prval(1) genpr(tr_vgd_con3)) changex(con 1 0 con_know 3 0 vgd 0 1 vgd_know 0 3)
simqi, fd(prval(1) genpr(tr_psi_con3)) changex(con 1 0 con_know 3 0 psi 0 1 psi_know 0 3)
simqi, fd(prval(1) genpr(tr_psp_con3)) changex(con 1 0 con_know 3 0 psp 0 1 psp_know 0 3)


setx median
setx vgd 1
setx vgd_know 3
setx vgd_D1 .486
setx vgd_know_D1 1.458
simqi, pr listx

simqi, fd(prval(1) genpr(fd_vgd3)) changex(vgd_D1 0.415 1.026 vgd_know_D1 .1245 3.618)


setx vgd_D1 0
setx vgd_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(tr_pty_vgd3)) changex(vgd 1 0 vgd_know 3 0 pty 0 1 pty_know 0 3)
simqi, fd(prval(1) genpr(tr_psi_vgd3)) changex(vgd 1 0 vgd_know 3 0 psi 0 1 psi_know 0 3)
simqi, fd(prval(1) genpr(tr_psp_vgd3)) changex(vgd 1 0 vgd_know 3 0 psp 0 1 psp_know 0 3)


setx median
setx pty 1
setx pty_know 3
setx pty_D1 .486
setx pty_know_D1 1.458
simqi, pr listx

simqi, fd(prval(1) genpr(fd_pty3)) changex(pty_D1 0.415 1.026 pty_know_D1 .1245 3.618)


setx pty_D1 0
setx pty_know_D1 0
simqi, pr listx


setx median
setx psi 1
setx psi_know 3
setx psi_D1 .486
setx psi_know_D1 1.458
simqi, pr listx

simqi, fd(prval(1) genpr(fd_psi3)) changex(psi_D1 0.415 1.026 psi_know_D1 .1245 3.618)


setx psi_D1 0
setx psi_know_D1 0
simqi, pr listx


setx median
setx psp 1
setx psp_know 3
setx psp_D1 .486
setx psp_know_D1 1.458
simqi, pr listx

simqi, fd(prval(1) genpr(fd_psp3)) changex(psp_D1 0.415 1.026 psp_know_D1 .1245 3.618)


setx psp_D1 0
setx psp_know_D1 0
simqi, pr listx


* Difference in baseline probabilities

tabstat tr_vgd_con3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_pty_con3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psi_con3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psp_con3, s(mean sd min p5 p10 p50 p90 p95 max)


tabstat tr_pty_vgd3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psi_vgd3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psp_vgd3, s(mean sd min p5 p10 p50 p90 p95 max)


* Calculate difference in first differences

gen dif_vgd_con3 = fd_vgd3 - fd_con3
gen dif_pty_con3 = fd_pty3 - fd_con3
gen dif_psi_con3 = fd_psi3 - fd_con3
gen dif_psp_con3 = fd_psp3 - fd_con3

tabstat dif_vgd_con3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_pty_con3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psi_con3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psp_con3, s(mean sd min p5 p10 p50 p90 p95 max)


gen dif_pty_vgd3 = fd_pty3 - fd_vgd3
gen dif_psi_vgd3 = fd_psi3 - fd_vgd3
gen dif_psp_vgd3 = fd_psp3 - fd_vgd3

tabstat dif_pty_vgd3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psi_vgd3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psp_vgd3, s(mean sd min p5 p10 p50 p90 p95 max)


* Knowledge = 4

setx median
setx con 1
setx con_know 4
setx con_D1 .486
setx con_know_D1 1.944
simqi, pr listx

simqi, fd(prval(1) genpr(fd_con4)) changex(con_D1 0.415 1.026 con_know_D1 .166 4.824)


setx con_D1 0
setx con_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(tr_pty_con4)) changex(con 1 0 con_know 4 0 pty 0 1 pty_know 0 4)
simqi, fd(prval(1) genpr(tr_vgd_con4)) changex(con 1 0 con_know 4 0 vgd 0 1 vgd_know 0 4)
simqi, fd(prval(1) genpr(tr_psi_con4)) changex(con 1 0 con_know 4 0 psi 0 1 psi_know 0 4)
simqi, fd(prval(1) genpr(tr_psp_con4)) changex(con 1 0 con_know 4 0 psp 0 1 psp_know 0 4)


setx median
setx vgd 1
setx vgd_know 4
setx vgd_D1 .486
setx vgd_know_D1 1.944
simqi, pr listx

simqi, fd(prval(1) genpr(fd_vgd4)) changex(vgd_D1 0.415 1.026 vgd_know_D1 .166 4.824)


setx vgd_D1 0
setx vgd_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(tr_pty_vgd4)) changex(vgd 1 0 vgd_know 4 0 pty 0 1 pty_know 0 4)
simqi, fd(prval(1) genpr(tr_psi_vgd4)) changex(vgd 1 0 vgd_know 4 0 psi 0 1 psi_know 0 4)
simqi, fd(prval(1) genpr(tr_psp_vgd4)) changex(vgd 1 0 vgd_know 4 0 psp 0 1 psp_know 0 4)


setx median
setx pty 1
setx pty_know 4
setx pty_D1 .486
setx pty_know_D1 1.944
simqi, pr listx

simqi, fd(prval(1) genpr(fd_pty4)) changex(pty_D1 0.415 1.026 pty_know_D1 .166 4.824)


setx pty_D1 0
setx pty_know_D1 0
simqi, pr listx


setx median
setx psi 1
setx psi_know 4
setx psi_D1 .486
setx psi_know_D1 1.944
simqi, pr listx

simqi, fd(prval(1) genpr(fd_psi4)) changex(psi_D1 0.415 1.026 psi_know_D1 .166 4.824)


setx psi_D1 0
setx psi_know_D1 0
simqi, pr listx


setx median
setx psp 1
setx psp_know 4
setx psp_D1 .486
setx psp_know_D1 1.944
simqi, pr listx

simqi, fd(prval(1) genpr(fd_psp4)) changex(psp_D1 0.415 1.026 psp_know_D1 .166 4.824)


setx psp_D1 0
setx psp_know_D1 0
simqi, pr listx


* Difference in baseline probabilities

tabstat tr_vgd_con4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_pty_con4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psi_con4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psp_con4, s(mean sd min p5 p10 p50 p90 p95 max)


tabstat tr_pty_vgd4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psi_vgd4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psp_vgd4, s(mean sd min p5 p10 p50 p90 p95 max)


* Calculate difference in first differences

gen dif_vgd_con4 = fd_vgd4 - fd_con4
gen dif_pty_con4 = fd_pty4 - fd_con4
gen dif_psi_con4 = fd_psi4 - fd_con4
gen dif_psp_con4 = fd_psp4 - fd_con4

tabstat dif_vgd_con4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_pty_con4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psi_con4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psp_con4, s(mean sd min p5 p10 p50 p90 p95 max)


gen dif_pty_vgd4 = fd_pty4 - fd_vgd4
gen dif_psi_vgd4 = fd_psi4 - fd_vgd4
gen dif_psp_vgd4 = fd_psp4 - fd_vgd4

tabstat dif_pty_vgd4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psi_vgd4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psp_vgd4, s(mean sd min p5 p10 p50 p90 p95 max)


* Low-knowledge high-knowledge differences

* Calculate difference in first differences

* Knowledge = 1 - Knowledge = 4

gen tr_vgd_con_1_4 = tr_vgd_con1 - tr_vgd_con4
gen tr_pty_con_1_4 = tr_pty_con1 - tr_pty_con4
gen tr_psi_con_1_4 = tr_psi_con1 - tr_psi_con4
gen tr_psp_con_1_4 = tr_psp_con1 - tr_psp_con4

tabstat tr_vgd_con_1_4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_pty_con_1_4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psi_con_1_4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psp_con_1_4, s(mean sd min p5 p10 p50 p90 p95 max)


gen dif_con_1_4 = fd_con1 - fd_con4
gen dif_vgd_1_4 = fd_vgd1 - fd_vgd4
gen dif_pty_1_4 = fd_pty1 - fd_pty4
gen dif_psi_1_4 = fd_psi1 - fd_psi4
gen dif_psp_1_4 = fd_psp1 - fd_psp4

tabstat dif_con_1_4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_vgd_1_4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_pty_1_4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psi_1_4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psp_1_4, s(mean sd min p5 p10 p50 p90 p95 max)


* Knowledge = 1 - Knowledge = 3

gen tr_vgd_con_1_3 = tr_vgd_con1 - tr_vgd_con3
gen tr_pty_con_1_3 = tr_pty_con1 - tr_pty_con3
gen tr_psi_con_1_3 = tr_psi_con1 - tr_psi_con3
gen tr_psp_con_1_3 = tr_psp_con1 - tr_psp_con3

tabstat tr_vgd_con_1_3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_pty_con_1_3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psi_con_1_3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psp_con_1_3, s(mean sd min p5 p10 p50 p90 p95 max)


gen dif_con_1_3 = fd_con1 - fd_con3
gen dif_vgd_1_3 = fd_vgd1 - fd_vgd3
gen dif_pty_1_3 = fd_pty1 - fd_pty3
gen dif_psi_1_3 = fd_psi1 - fd_psi3
gen dif_psp_1_3 = fd_psp1 - fd_psp3

tabstat dif_con_1_3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_vgd_1_3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_pty_1_3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psi_1_3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psp_1_3, s(mean sd min p5 p10 p50 p90 p95 max)


* Knowledge = 1 - Knowledge = 2

gen tr_vgd_con_1_2 = tr_vgd_con1 - tr_vgd_con2
gen tr_pty_con_1_2 = tr_pty_con1 - tr_pty_con2
gen tr_psi_con_1_2 = tr_psi_con1 - tr_psi_con2
gen tr_psp_con_1_2 = tr_psp_con1 - tr_psp_con2

tabstat tr_vgd_con_1_2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_pty_con_1_2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psi_con_1_2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat tr_psp_con_1_2, s(mean sd min p5 p10 p50 p90 p95 max)


gen dif_con_1_2 = fd_con1 - fd_con2
gen dif_vgd_1_2 = fd_vgd1 - fd_vgd2
gen dif_pty_1_2 = fd_pty1 - fd_pty2
gen dif_psi_1_2 = fd_psi1 - fd_psi2
gen dif_psp_1_2 = fd_psp1 - fd_psp2

tabstat dif_con_1_2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_vgd_1_2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_pty_1_2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psi_1_2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_psp_1_2, s(mean sd min p5 p10 p50 p90 p95 max)


drop b1-b20
drop fd_con1-dif_psp_1_2

*log close


set more off

*log using "...\1805 Roadmaps\Table A9 any info.log", replace

set seed Xecab35358f70ae9e27e06ec89758e9d6000445f7


probit vote_leemar ///
     con con_know con_D1 con_know_D1 ///
     all_info all_info_know all_info_D1 all_info_know_D1 ///
     , noconstant

tabstat know_sco if e(sample), s(n mean sd min p25 p50 p75 max)
tabstat d1 if e(sample), s(n mean sd min p25 p50 p75 max)


estsimp probit vote_leemar ///
     con con_know con_D1 con_know_D1 ///
     all_info all_info_know all_info_D1 all_info_know_D1 ///
     , noconstant


* Knowledge = 1

setx median
setx con 1
setx con_know 1
setx con_D1 .486
setx con_know_D1 .486
setx all_info 0
setx all_info_know 0
setx all_info_D1 0
setx all_info_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(fd_con1)) changex(con_D1 .0415 1.026 con_know_D1 .0415 1.026)


setx con_D1 0
setx con_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(tr_all_info_con1)) changex(con 1 0 con_know 1 0 all_info 0 1 all_info_know 0 1)


setx median
setx all_info 1
setx all_info_know 1
setx all_info_D1 .486
setx all_info_know_D1 .486
simqi, pr listx

simqi, fd(prval(1) genpr(fd_all_info1)) changex(all_info_D1 .0415 1.026 all_info_know_D1 .0415 1.026)


setx all_info_D1 0
setx all_info_know_D1 0
simqi, pr listx


* Difference in baseline probabilities

tabstat tr_all_info_con1, s(mean sd min p5 p10 p50 p90 p95 max)


* Calculate difference in first differences

gen dif_all_info_con1 = fd_all_info1 - fd_con1

tabstat dif_all_info_con1, s(mean sd min p5 p10 p50 p90 p95 max)


* Knowledge = 2

setx median
setx con 1
setx con_know 2
setx con_D1 .486
setx con_know_D1 .972
setx all_info 0
setx all_info_know 0
setx all_info_D1 0
setx all_info_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(fd_con2)) changex(con_D1 .0415 1.026 con_know_D1 .083 2.412)


setx con_D1 0
setx con_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(tr_all_info_con2)) changex(con 1 0 con_know 2 0 all_info 0 1 all_info_know 0 2)


setx median
setx all_info 1
setx all_info_know 2
setx all_info_D1 .486
setx all_info_know_D1 .972
simqi, pr listx

simqi, fd(prval(1) genpr(fd_all_info2)) changex(all_info_D1 .0415 1.026 all_info_know_D1 .083 2.412)


setx all_info_D1 0
setx all_info_know_D1 0
simqi, pr listx


* Difference in baseline probabilities

tabstat tr_all_info_con2, s(mean sd min p5 p10 p50 p90 p95 max)


* Calculate difference in first differences

gen dif_all_info_con2 = fd_all_info2 - fd_con2

tabstat dif_all_info_con2, s(mean sd min p5 p10 p50 p90 p95 max)


* Knowledge = 3

setx median
setx con 1
setx con_know 3
setx con_D1 .486
setx con_know_D1 1.458
setx all_info 0
setx all_info_know 0
setx all_info_D1 0
setx all_info_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(fd_con3)) changex(con_D1 .0415 1.026 con_know_D1 .1245 3.618)


setx con_D1 0
setx con_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(tr_all_info_con3)) changex(con 1 0 con_know 3 0 all_info 0 1 all_info_know 0 3)


setx median
setx all_info 1
setx all_info_know 3
setx all_info_D1 .486
setx all_info_know_D1 1.458
simqi, pr listx

simqi, fd(prval(1) genpr(fd_all_info3)) changex(all_info_D1 .0415 1.026 all_info_know_D1 .1245 3.618)


setx all_info_D1 0
setx all_info_know_D1 0
simqi, pr listx


* Difference in baseline probabilities

tabstat tr_all_info_con3, s(mean sd min p5 p10 p50 p90 p95 max)


* Calculate difference in first differences

gen dif_all_info_con3 = fd_all_info3 - fd_con3

tabstat dif_all_info_con3, s(mean sd min p5 p10 p50 p90 p95 max)


* Knowledge = 4

setx median
setx con 1
setx con_know 4
setx con_D1 .486
setx con_know_D1 1.944
setx all_info 0
setx all_info_know 0
setx all_info_D1 0
setx all_info_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(fd_con4)) changex(con_D1 .0415 1.026 con_know_D1 .166 4.824)


setx con_D1 0
setx con_know_D1 0
simqi, pr listx

simqi, fd(prval(1) genpr(tr_all_info_con4)) changex(con 1 0 con_know 4 0 all_info 0 1 all_info_know 0 4)


setx median
setx all_info 1
setx all_info_know 4
setx all_info_D1 .486
setx all_info_know_D1 1.944
simqi, pr listx

simqi, fd(prval(1) genpr(fd_all_info4)) changex(all_info_D1 .0415 1.026 all_info_know_D1 .166 4.824)


setx all_info_D1 0
setx all_info_know_D1 0
simqi, pr listx


* Difference in baseline probabilities

tabstat tr_all_info_con4, s(mean sd min p5 p10 p50 p90 p95 max)


* Calculate difference in first differences

gen dif_all_info_con4 = fd_all_info4 - fd_con4

tabstat dif_all_info_con4, s(mean sd min p5 p10 p50 p90 p95 max)


* Low-knowledge high-knowledge differences

* Calculate difference in first differences

* Knowledge = 1 - Knowledge = 4

gen tr_all_info_con_1_4 = tr_all_info_con1 - tr_all_info_con4

tabstat tr_all_info_con_1_4, s(mean sd min p5 p10 p50 p90 p95 max)


gen dif_con_1_4 = fd_con1 - fd_con4
gen dif_all_info_1_4 = fd_all_info1 - fd_all_info4

tabstat dif_con_1_4, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_all_info_1_4, s(mean sd min p5 p10 p50 p90 p95 max)


* Knowledge = 1 - Knowledge = 3

gen tr_all_info_con_1_3 = tr_all_info_con1 - tr_all_info_con3

tabstat tr_all_info_con_1_3, s(mean sd min p5 p10 p50 p90 p95 max)


gen dif_con_1_3 = fd_con1 - fd_con3
gen dif_all_info_1_3 = fd_all_info1 - fd_all_info3

tabstat dif_con_1_3, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_all_info_1_3, s(mean sd min p5 p10 p50 p90 p95 max)


* Knowledge = 1 - Knowledge = 2

gen tr_all_info_con_1_2 = tr_all_info_con1 - tr_all_info_con2

tabstat tr_all_info_con_1_2, s(mean sd min p5 p10 p50 p90 p95 max)


gen dif_con_1_2 = fd_con1 - fd_con2
gen dif_all_info_1_2 = fd_all_info1 - fd_all_info2

tabstat dif_con_1_2, s(mean sd min p5 p10 p50 p90 p95 max)
tabstat dif_all_info_1_2, s(mean sd min p5 p10 p50 p90 p95 max)


drop b1-b8
drop fd_con1-dif_all_info_1_2

*log close

* End
